package everyday;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: Siantar
 * @Date: 2023-07-12-15:32
 * @Description: 1.0
 */
public class T2178 {
    public List<Long> maximumEvenSplit(long finalSum) {
        if (finalSum % 2 != 0) return new ArrayList<>();
        int m = (int) Math.pow(finalSum, 0.5);
        while ((long) m * (m + 1) <= finalSum) m++;
        m--;
        System.out.println(m);
        List<Long> res = new ArrayList<>(m);
        for (long i = 2; i < m * 2L; i += 2) {
            res.add(i);
        }
        res.add(finalSum - (long) m * (m - 1));
        return res;
    }
}
